#/usr/bin/python
# coding: utf8

import time
from  PAM30 import PAM30
import sys
import win32api
import win32con

reload(sys)
sys.setdefaultencoding("utf-8")


def countItem():
    '''
    统计当前搜索结果的商品总个数
    '''
    cntdiv = ie.findElement('div', 'id', 'list-content')
    list = ie.findElement('li', 'class', 'list-item', ie.getElementChildren(cntdiv))
    print list.length




ie= PAM30.PAMIE()

time.sleep(1)
ie.navigate('http://s.taobao.com/search?q=%B0%EB%B8%DF%B8%FA%D0%AC&searcy_type=item&s_from=newHeader&source=&ssid=s5-e&search=y&initiative_id=itemz_20120825')  

time.sleep(2)
countItem()
